#ifndef UUID_501AAE3EEEE44324F12D9EADABE2DAE0
#define UUID_501AAE3EEEE44324F12D9EADABE2DAE0

#include "psync.hpp"

extern "C"
{
#include "lauxlib.h"
#include "lualib.h"
#include "luajit.h"
#include "luaext.h"
}

#include "../luautil/luautil.hpp"

#include "node.hpp"

#define LUAF(name) extern "C" int luapsync_##name(lua_State* L)
#define LUAN(name) {#name, luapsync_##name}
#define LUAN2(name1, name2) {#name1, luapsync_##name2}

LUAF(create_node);

LUAF(node_host);
LUAF(node_gc);
LUAF(node_connect);
//LUAF(node_put_section);
LUAF(node_extract_serializer);
LUAF(node_process);
//LUAF(node_send_packet_all);
//LUAF(node_next_section);
LUAF(node_next_event);
LUAF(node_disconnect);
LUAF(node_link_latency);
LUAF(node_set_accept_connections);
LUAF(node_link_send_packet);
LUAF(node_link_time_for_packet);

extern int psync_core_node_tag;

inline LuaNode& check_node(lua_State* L, int idx)
{
	return check_object<LuaNode>(L, idx, &psync_core_node_tag, "expected node");
}

#endif // UUID_501AAE3EEEE44324F12D9EADABE2DAE0
